package com.etc.service.impl;

import java.util.List;

import com.etc.dao.impl.ArticleDaoImpl;
import com.etc.entity.Article;
import com.etc.service.IArticleService;
import com.etc.util.PageData;

public class ArticleServiceImpl implements IArticleService{
	ArticleDaoImpl dao=new ArticleDaoImpl();

	@Override
	public List<Article> getArticles() {
		
		return dao.queryArticles();
	}

	@Override
	public boolean addArticle(Article article) {
		
		return dao.addArticle(article);
	}

	@Override
	public boolean delArticle(int articleId) {
		// TODO Auto-generated method stub
		return dao.delArticle(articleId);
	}

	@Override
	public boolean updateArticle(Article article) {
		// TODO Auto-generated method stub
		return dao.updateArticle(article);
	}

	@Override
	public List<Article> getArticleByLike(String articleLike) {
		// TODO Auto-generated method stub
		return dao.queryArticleByLike(articleLike);
	}

	@Override
	public List<Article> getTopArticles() {
		// TODO Auto-generated method stub
		return dao.queryTopArticles();
	}

	@Override
	public Article getArticleById(int articleId) {
		// TODO Auto-generated method stub
		return dao.queryArticleById(articleId);
	}

	@Override
	public List<Article> getByTitle(String title) {
		// TODO Auto-generated method stub
		return dao.seachByTitle(title);
	}

	@Override
	public PageData getArticleByLikePage(int pageNo, int pageSize, String titleKey) {
		// TODO Auto-generated method stub
		return dao.queryArticleByLikePage(pageNo, pageSize, titleKey);
	}

}
